package com.itheima01.controller;

import com.itheima01.domian.Student;
import com.itheima01.service.StudentService;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.junit.Test;

import java.util.Date;
import java.util.List;
import java.util.Scanner;

public class StudentController {
    private static StudentService service=new StudentService();
    @Test
    public void findAll(){
        List<Student> students = service.finAll();
        System.out.println(students);
    }
    @Test
    public void findId(){
        Student student = service.finId(2);
        System.out.println(student);
    }
    @Test
    public void addStudent(){
        int result = service.addStudent(new Student(4, "xc", 19, new Date()));
        if (result!=0){
            System.out.println("添加成功");
        }else{
            System.out.println("添加失败");
        }
    }
}
